1. Field of the Invention
This invention relates a data recording apparatus and its method, and more particularly, is suitably applied to a data recording apparatus (tape streamer) which records back-up data of a computer on a magnetic tape.
2. Description of the Related Art
In recent years, data compression technology has been progressed, and so a data recording apparatus, including a tape streamer, has appeared which can record data exceeding the physical storage capacity on a recording medium by performing data compression processing without decreasing of quantity of information in real time.
FIG. 1 shows a constitution of a tape streamer out of such data recording apparatuses.
In this case, a host computer 1 usually divides one file of data D1 into plural data blocks, and then transfers it to a tape streamer 2 in units of a data blocks. Besides, the host computer 1 transfers a record command of a tape mark indicating the end of the file, at the last of each file.
Then, the tape streamer 2 sequentially takes in the data D1 supplied from the host computer 1 via an interface bus, through an interface controller 3, and then delivers this to a data compressor 5 and a first switching terminal 6A of a switch circuit 6 in units of a data block under the control of a CPU 4.
The data compressor 5 performs compression coding on the supplied data D1 with a stated format in units of a data block, and then delivers the resulted one data block of compressed data D2 to a second switching terminal 6B of the switch circuit 6, under the control of the CPU 4.
At this time, the CPU 4 has already selected either of a non-compression mode or a compression mode on the basis of a command given from the host computer 2; at the time of the non-compression mode, it causes the switch circuit 6 to select the first switching terminal 6A in order to transfer the non-compressed original data D1 to a buffer memory 7; on the other hand, at the time of the compression mode, it causes the switch circuit 6 to select the second switching terminal 6B in order to transfer the compressed data D2 to, the buffer memory 7.
Under the control of the CPU 4, the buffer memory 7 sequentially stores the supplied data D1 or compressed data D2, and delivers the stored data D1 or compressed data D2 to a data processing section 8 after adding the identifying information of the non-compressed data or compressed data to it.
Then, the data processing section 8 performs stated data processing such as addition of error correcting code on the data D1 or the compressed data D2 which is supplied from the buffer memory 7, and then records this on a magnetic tape 10 via a recording head 9, under the control of the CPU 4.
In addition, when a record command of a tape mark has been given from the CPU 4, the data processing section 8 records the tape mark on the magnetic tape 10 via the recording head 9.
In this way, in the tape streamer 2, the data D1 which is supplied from the host computer 1 can be recorded on the magnetic tape 10 in units of a data block with adding a tape mark TM to the last of each file, as shown in FIG. 2.
By the way, in the tape streamer 2, the compression rate of the data D1 greatly varies because of depending on the property of a string of data which is inputted to the data compressor 5.
In fact, in the case where a string of data which has been highly randomized is inputted as the data D1, data extension may occur on the contrary by passing it through the data compressor 5, and the data length of the compressed data D2 may become longer than the data length of the original data D1.
And, such a case has a problem in that the substantial quantity of data which is recorded on the magnetic tape 10 by the tape streamer 2 becomes smaller than the physical storage capacity of the magnetic tape 10.
As one method to solve such a problem, it has been proposed that a tape streamer 11 is composed as shown in FIG. 3 in which the same reference numerals are applied to parts corresponding to FIG. 1.
In fact, the tape streamer 11 is provided with a buffer memory (hereinafter, this is referred to as an original-data holding buffer-memory) 13 in parallel to a data compressor 12, in which the data D1 to be transferred to the data compressor 12 is stored in the original-data holding buffer-memory 13.
Then, the data compressor 12 sequentially compresses the supplied data D1 in units of a data block, and then sequentially delivers the obtained compressed data D2 to a second switching terminal 14B of a switch circuit 14, and also delivers information indicating whether or not data extension has occurred in consequence of the compression processing, to a CPU 15 as a data-extension information signal S1 for each data block.
At the time of the compression mode, the CPU 15 controls and causes the switch circuit 6 to select the second switching terminal 6B, and in addition, judges based on the data-extension information signal S1 whether or not the data extension has occurred. In the case where it has determined that the data extension has not occurred, the CPU 15 controls and causes the switch circuit 14 to select the second switching terminal 14B, thereby the very data block of the compressed data D2 is given to the data processing section 8, via the switch circuit 14, the switch circuit 6, and the buffer memory 7 sequentially, in order to record this on the magnetic tape 10 via the recording head 9.
In contrast with this, when the CPU 15 has determined based on the data-extension information signal S1 at the time of the compression mode that the data extension has occurred, it causes the switch circuit 14 to select the first switching terminal 14A, thereby with respect to the very data block, the original data D1 stored in the original-data holding buffer-memory 13 is given to the data processing section 8, via the switch circuit 14, the switch circuit 6, and the buffer memory 7 sequentially, in order to record this on the magnetic tape 10 via the recording head 9.
In this way, for each data block, the tape streamer 11 selects either one which has less data-quantity, out of the original data D1 and the compressed data D2 so as to record it on the magnetic tape 10, and thus can prevent suffering bad influence from the data extension which occurs in consequence of the compression processing (that is, the substantial record quantity of data becomes smaller than the physical storage capacity of the magnetic tape 10).
However, the case where a tape streamer is composed in this way has such problems in that it is needed to add the original-data holding buffer-memory 13 and the switch circuit 14 to the tape streamer 2 of FIG. 1 as described above, and so the constitution is complicated and enlarged as a whole.
Besides, the case where a tape streamer is composed in this way has such problems in that a buffer memory having large storage capacity is needed as the original-data holding buffer-memory 13 and so the manufacturing cost of the tape streamer 11 is raised correspondingly, when the data quantity of each data block becomes large as the case where the data D1 to be supplied from the host computer 1 is, for instance, image data.